package com.gp.model.entity;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;

@TableName("base_cart")
public class BaseCart extends Model<BaseCart> {

  private static final long serialVersionUID = 1L;

  private Long id;

  private Long userId;

  private Long goodsId;

  private Integer number;

  /**
   * 自定义填充的创建时间
   */
  @TableField(fill = FieldFill.INSERT) // 该注解插入忽略验证，自动填充

  private Date createTime;
  /**
   * 自定义填充的最后一次修改时间
   */
  @TableField(fill = FieldFill.UPDATE) // 该注解插入忽略验证，自动填充
  private Date lastModifiedTime=new Date();

  public BaseCart() {}
  
  public BaseCart(Long userId, Long goodsId, Integer number ) {
    this.userId = userId;
    this.goodsId = goodsId;
    this.number = number;
  }
  
  public BaseCart(Long userId, Long goodsId, Integer number,Date lastModifiedTime) {
    this.userId = userId;
    this.goodsId = goodsId;
    this.number = number;
    this.lastModifiedTime = lastModifiedTime;
  }
  
  public BaseCart(Long id2, Long goodsId2) {
    this.userId=id2;
    this.goodsId=goodsId2;
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getUserId() {
    return userId;
  }

  public void setUserId(Long userId) {
    this.userId = userId;
  }

  public Long getGoodsId() {
    return goodsId;
  }

  public void setGoodsId(Long goodsId) {
    this.goodsId = goodsId;
  }

  public Integer getNumber() {
    return number;
  }

  public void setNumber(Integer number) {
    this.number = number;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public Date getLastModifiedTime() {
    return lastModifiedTime;
  }

  public void setLastModifiedTime(Date lastModifiedTime) {
    this.lastModifiedTime = lastModifiedTime;
  }

  public static long getSerialversionuid() {
    return serialVersionUID;
  }

  @Override
  protected Serializable pkVal() {
    return this.id;
  }

}
